<extend name="Layout/ins_popup" />
<block name="content">
	{:W('PageHeader/popup',array('name'=>'选择部门','search'=>'N'))}
	<input type="hidden" name="val" id="val">
	<input type="hidden" name="name" id="name">
	<div class="popup_tree_menu well">
		<ul class="tree_menu">
			{$menu}
		</ul>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function save() {
			if ($("#name").val().length > 0) {
				$("#dept_name", parent.document).val($("#name").val());
				$("#dept_id", parent.document).val($("#val").val());

			} else {
				ui_error("请选择部门");
				return false;
			}
			myclose();
		}

		$(document).ready(function() {
			$(".popup_tree_menu a").click(function() {
				$("#val").val($(this).attr("node"));
				$("#name").val($(this).children("span").text());
				$(".popup_tree_menu .tree_menu  a.active").removeClass("active");
				$(this).addClass("active");
			});
		});
	</script>
</block>
